Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates dismemberment/delimbing and weapon sharpness #12050

Merged
merged 9 commits into from
Dec 24, 2024

Conversation

Rukofamicom
Copy link
Contributor

About The Pull Request

This adds two new categories of sharpness on top of the existing two, all four sharpness categories are:

  • IS_BLUNT which is for blunt weapons that are not sharp.
  • IS_SHARP which is for sharp, but smaller or lighter objects such as knives and scalpels.
  • IS_SHARP_DISMEMBER is for weapons such as swords, axes and chainsaws, and also includes the chef's cleaver and due to its smaller size the energy dagger.
  • IS_SHARP_DISMEMBER_EASY is primarily for weapons with energy blades such as energy swords and the ninja's energy katana, the weapons that cut through flesh and bone like butter. The nightmare's light eater is the only non-energy weapon that fits in this category.

In addition to the above this PR refactors how dismemberment is calculated entirely:

  • If the mob has trait for easy limb dismemberment (such as skeletons/oozelings) and the limb has already sustained at least some damage, any weapons (even blunt ones) have a chance equal to their damage output to dismember it.
  • If the weapon is sharp enough for easy delimbing, it has a chance equal to its damage output for immediate dismemberment, even if the limb has taken no prior damage.
  • If the weapon is sharp enough for normal dismemberment, it will only dismember a limb that has already been fully disabled with brute/burn damage before the current attack. Fire axes are cleaving chunks out of people, but they won't fully cut a limb off without at least three chops.
  • If the weapon is sharp, but not sharp enough for normal dismemberment, it can only dismember if the target is dead.
  • If the weapon is blunt, the only way it can dismember is meeting the criteria in the first bullet point.
  • If the limb being targetted is the head, even if other criteria listed above is met, the dismember will fail if the target is not at least in crit. No beheading people who are still upright for game balance reasons, even if an energy sword would/should be able to do so.
  • If the mob can't be delimbed for whatever reason, all of the above will fail to delimb

Now for some examples from each category:

  • An energy sword has IS_SHARP_DISMEMBER_EASY so every swing will have a 30% chance to dismember the targetted limb. Because it does 30 damage, even if the target is armored the limb will probably be disabled in two hits, meaning the third hit is guaranteed to dismember the targetted limb.
  • A fire axe has IS_SHARP_DISMEMBER so it can only dismember a targetted limb that has already been fully disabled. This means against an unarmored person it will take a minimum of three hits, and some armored players will take four.
  • A laser scalpel has IS_SHARP so it can only delimb a player who is already completely dead
  • A toolbox can never delimb anyone unless the target has the easy delimb trait themselves. Then it has a 12% chance per attack to delimb

Why It's Good For The Game

In #11802 I brought up the testing done in the battle royal server's environment, but there was a critical change that affected delimbing on Bee since then which I didn't consider. The aftermath of that PR and the fact that item weights are factored into delimbing made for several unusual cases.

After discussion with Bacon, this seems to address most of the balance issues with delimbing in general, while still keeping with the core spirit of the PR and improved game balance overall. Security still has to deal with potentially being de-limbed, and all players still have more reason to target specific limbs depending on their exact priorities.

If it is decided that limb targeting is bad for the game overall, this PR should simply be closed and #11802 fully reverted.

Testing Photographs and Procedure

Testing evidence here

image

image

Still pictures don't really do much for this, so here's the exact breakdown of testing:

  • Spawn blunt object and skeleton. Whack skeleton until arm comes off
  • Spawn normal human, whack leg until death to see if it ever comes off
  • Spawn normal human and energy Katana, observe random delimbing as well as guaranteed delimbing in three hits
  • Spawn normal human and fire axe, observe exlusively three hit delimbing, repeat three times
  • Spawn human and scalpel, kill them through limb damage and observe dismemberment immediately after death
  • Change force value on Katana to 100 and observe 100% delimbing chance
  • Realize I can decapitate instantly with energy weapons and fix the code for it
  • Verify decapitation is no longer possible on fully conscious targets

Changelog

🆑
balance: Completely overhauled dismemberment and weapon sharpness. Weapons now have four levels of sharpness: Blunt, Sharp, Dismember and Easy Dismember.
balance: Blunt weapons are now only able to cause dismemberment on species that have the easy dismemberment trait, all of which can easily regenerate or otherwise slap their dismembered limb back into place.
balance: Species with the easy dismemberment trait (Skeletons, IPCs, Oozelings) have a chance equal to the damage received to lose a targetted limb as long as the limb was already damaged before being struck.
balance: Ordinary sharp weapons such as knives and surgical tools can only dismember a dead target.
balance: Large weapons such as swords, axes and chainsaws are only able to dismember a limb which has already been fully disabled. This means that it will take at least three hits with a fire axe to take someone's leg off.
balance: Bladed energy weapons have a chance equal to their damage to dismember a targetted limb regardless of how much damage it has taken, in addition to being guaranteed to dismember a limb that has been fully disabled by damage. The nightmare's light eater is the only non-energy weapon in this group right now.
balance: Mobs cannot be decapitated through the simplified mechanics while they are fully conscious - they must at minimum be asleep or in crit in order for dismemberment to apply when targetting someone's head for balance reasons.
/:cl:

@Rukofamicom Rukofamicom changed the title Updates delimbing and weapon sharpness Updates dismemberment/delimbing and weapon sharpness Dec 19, 2024
@Tsar-Salat
Copy link
Contributor

I don't really have anything to comment besides, can we dispense with the IS_ prefix entirely?

No other var or define looks like this and it's ugly every time I look at it. var/sharpness and SHARP would work fine

@Rukofamicom
Copy link
Contributor Author

I have no reason not to

@Rukofamicom
Copy link
Contributor Author

Done

@@ -78,6 +78,7 @@
var/hit_amount = (100 - armour_block) / 100
add_bleeding(I.bleed_force * hit_amount)
if(I.force)
var/limb_health = affecting.get_damage() //We need to save this for later to simplify dismemberment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call this limb damage instead of limb health to avoid any confusion

@@ -1773,6 +1773,7 @@ GLOBAL_LIST_EMPTY(features_by_species)

var/armor_block = H.run_armor_check(affecting, MELEE, "<span class='notice'>Your armor has protected your [hit_area]!</span>", "<span class='warning'>Your armor has softened a hit to your [hit_area]!</span>",I.armour_penetration)
var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords)
var/limb_health = affecting.get_damage() //We need to save this for later to simplify dismemberment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that this is copy and pasted, but if this is just how it's done... I'd much rather this be some kind of generic proc on carvon/human which both of these cases call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a very subtle difference but yeah I was pretty baffled at first as to why it was like this.

Monkeys are the only thing that still uses carbon defense and the PR that moved them to species didn't survive.

@PowerfulBacon
Copy link
Member

Also changeling armblade and heretic blade should easy dismember

@Rukofamicom
Copy link
Contributor Author

Updated:

  • Variable name from limb_health to limb_damage
  • Sharpness of heretic and changeling blades to easy dismember
  • Sharpness of armblade sting to blunt, in order to match the item's flavor and description (it is described as scary looking, but actually blunt and no stronger than bare hands in combat)
  • Override the sharpness of synthetic armblades back to normal dismemberment
  • Override the sharpness of nanite armblades back to normal dismemberment
  • Override the sharpness of xenobiology armblades back to normal dismemberment

@Rukofamicom
Copy link
Contributor Author

Failed test is just echo disposals again

var/dismember_limb = FALSE
var/weapon_sharpness = I.is_sharp()

if((HAS_TRAIT(src, TRAIT_EASYDISMEMBER) && limb_damage) || weapon_sharpness == SHARP_DISMEMBER_EASY && prob(I.force))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intended order of operations here? If you have TRAIT_EASYDISMEMBER then you will have a 100% chance to lose limbs regardless of the force due to precedence.

With proper parenthesis, this expression looks like this:
(HAS_TRAIT(src, TRAIT_EASYDISMEMBER) && limb_damage) || (weapon_sharpness == SHARP_DISMEMBER_EASY && prob(I.force))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching that, I overlooked it when I got tired of arguing about my older logic (before the PR was posted) being fine with dragon and just copied his to appease him because I didn't want it to block the PR when it was posted.

I'll fix it up now - the correct order of operations is:

  • If the mob has easy dismember and a damaged limb -> direct % chance equal to force to dismember.
  • If the weapon has easy dismember -> direct % chance equal to force to dismember

var/dismember_limb = FALSE
var/weapon_sharpness = I.is_sharp()

if((HAS_TRAIT(H, TRAIT_EASYDISMEMBER) && limb_damage) || weapon_sharpness == SHARP_DISMEMBER_EASY && prob(I.force))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as here, wrap it in proper brackets to show your intended behaviour

Copy link
Contributor Author

@Rukofamicom Rukofamicom Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swear to god I'm going to gut someone over my logic being fine the first time around

AND OR AND OR OR AND OR AND AND OR AND
@PowerfulBacon PowerfulBacon added this pull request to the merge queue Dec 24, 2024
Merged via the queue into BeeStation:master with commit 695ebd0 Dec 24, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants